Traditionally, viewable documents have been stored as a set of pages. When a user wishes to view a document, all pages of the document would be opened, loaded into memory, and presented to the user upon demand. This approach may consume excessive memory, with portions of the documents being loaded despite the fact that the user may never demand to view them. However, page-based markup documents are becoming more widely used. With page-based markup documents, pages are retrieved, marked up, and loaded into memory upon demand, resulting in reduced memory consumption and faster performance.
When a user wishes to, for example, search for a given string within a page-based markup document, this may present challenges. To do a comprehensive search, all pages of the markup document may be loaded and rendered before the precise location of the search string can be determined. Assuming that loading and rendering each page takes a given amount of time, the overall search process would take at least that given amount of time, multiplied by the total number of pages in the document. For some documents, this scenario may be unacceptable, and may result in excessively lengthy search times.